<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "suggest".
 *
 * @property integer $id
 * @property string $name
 * @property string $email
 * @property string $subject
 * @property string $body
 * @property string $verifycode
 */
class Suggest extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'suggest';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'email', 'subject', 'body', 'verifycode'], 'required'],

            [['name'], 'string', 'max' => 32],
            [['email'], 'string', 'max' => 64],
            [['subject'], 'string', 'max' => 128],
            [['body'], 'string', 'max' => 1024],
            ['email', 'email'],
            ['verifycode', 'captcha'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '用户名',
            'email' => '电子邮箱',
            'subject' => '主题',
            'body' => '意见或建议',
            'verifycode' => '验证码',
        ];
    }
}
